package casia.isiteam.springbootshiro.model.po.common;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Author wzy
 * Date 2018/1/15 17:15
 */
public interface InstitutionRepository extends JpaRepository<Institution,Integer> {
    @Transactional(timeout = 10)//事务，超时10秒
    @Modifying
    Institution save(Institution institution);

    @Query("SELECT d  FROM Institution i , Department d where i.id=d.instId and i.id=?1")
    List queryDup(int id);
}
